home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
batchut
/
envtime.zip
/
ENVTIME.DOC
next >
Wrap
Text File
|
1993-01-01
|
2KB
|
70 lines
ENVTIME
Copyright 1992
Steve Antonoff
Stone Mountain, GA
Released for FREE, NONCOMMERCIAL use and distribution.
ENVTIME allows the user to create environment varialbles that contain
the current date and time. These variables can then be used to make
decisions or to create file names, etc, in BATch files.
ENVTIME is simple to use. The output is a series of "SET" commands that
must be redirected to a BAT file, then the BAT file executed. For
example, in the file "MAIN.BAT", insert the following lines:
envtime > settime.bat
call settime
del settime.bat
Notice the use of "CALL" so that MAIN.BAT resumes operation after
SETTIME.BAT is executed. This will only work in DOS 3.3 and higher.
The batch file created will look like:
@echo off
Set YEAR=1992
Set PYEAR=1991
Set YR=92
Set PYR=91
Set MON=07
Set DOM=18
Set DOW=Sat
Set HOUR=12
Set MIN=01
Set YDOM=17
Set YMON=07
Set YYEAR=1992
Set YYR=92
Thus, the environment variables created will be:
YEAR - 4 digit year
PYEAR - 4 digit previous year
YR - 2 digit year
PYR - 2 digit previous year
MON - 2 digit month
DOM - 2 digit day of month
DOW - 3 character day of week (Sun, etc)
HOUR - 2 digit hour of day
MIN - 2 digit minute of hour
YDOM - 2 digit yesterday day of month
YMON - 2 digit yesterday month
YYEAR - 4 digit yesterday year
YYR - 2 digit yesterday year
All numeric variables will include a leading zero, if necessary, to fill
the field. For example, at 1AM the HOUR variable will be set to 01.
This program is released for FREE, NON-COMMERCIAL use and distribution.
All other uses requrire written permission from the author.
Requests for commercial use, suggestions, etc, may be sent to:
Steve Antonoff
3917 Garfield Dr.
Stone Mountain, GA 30083
FIDOnet address: 1:133/302@fidonet